package indi.xielin.start.injector;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import indi.xielin.start.method.DeleteAllMethod;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 *  @author  xielin
 *  @date  2022/10/16  23:16
 */

@Component
public class MyInjector2 extends DefaultSqlInjector {
    /**
     *  在这里添加自定义的Sql的AbstractMethod实现类，完成SQL注入.
     * @param mapperClass
     * @param tableInfo
     * @return
     */
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
        methodList.add(new DeleteAllMethod());
        return methodList;
    }
}
